﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script language="javascript" type="text/javascript">
    <!--
        var i = 0;

        function addRow() {//添加表格的一行
            oTR = idTB.insertRow(idTB.rows.length);
            tmpNum = oTR.rowIndex;
            oTD = oTR.insertCell(0);
            oTD.innerText = "第" + tmpNum + "行"; //在该处添加的HTML代码会原封不动的显示在页面上
            oTD.innerHTML = "第" + tmpNum + "行" + "<input  length='5' type='text' name='txt" + tmpNum + "' value='" + tmpNum + "'>"; //要在该格添加的HTML代码填在这里，因为这里是text，注意不要重名了。
            idLast.innerText = idTB.rows.length - 1;
            if (idTB.rows.length > 0)
                idFirst.innerText = '1';
            return true;
        }
        function delRow() {//删除表格的一行
            sIndex = idIndex.value;
            if (sIndex == '')
                sIndex = idTB.rows.length - 1;
            else
                sIndex = parseInt(sIndex) - 1;

            if (sIndex > 1) {
                idTB.deleteRow(sIndex);
            }


            idLast.innerText = idTB.rows.length - 1;
            if (idTB.rows.length == 0)
                idFirst.innerText = '0';
        }
//-->
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table id="idTB" border="1">
            <!--注意id，与JS中的要相对应-->
            <tr id="idTR">
            </tr>
        </table>
        <input type="button" onclick="addRow()" value="添加一行" />
        <input type="button" onclick="delRow()" value="删除一行" />
        删除哪一行:<input id="idIndex" length="5" />(<a id="idFirst">1</a>~<a id="idLast">0</a>)
        <br />
        <br />
        <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="2">
            <WizardSteps>
                <asp:WizardStep runat="server" title="Step 1">
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </asp:WizardStep>
                <asp:WizardStep runat="server" title="Step 2">
                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                </asp:WizardStep>
                <asp:WizardStep runat="server" Title="3">
                    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                </asp:WizardStep>
            </WizardSteps>
        </asp:Wizard>
    </div>
    </form>
</body>
</html>
